<@t.header>
<link rel="stylesheet" href="${request.contextPath}/app/contract/css/contract-view.css">
</@t.header> <@t.body> <#if !data??>
<div class="container" style="padding-top: 60px;">
	<div class="row">
		<div class="col-md-12">
			<div class="alert alert-danger" role="alert">
				<strong>数据错误！</strong>
				无效的合同信息或者系统异常！
			</div>
		</div>
	</div>
</div>
<#else> <#setting url_escaping_charset='utf-8'>
<div class="navbar navbar-default navbar-fixed-top padding-0 margin-0">
	<div class="container-fluid">
		<div class="navbar-header">
			<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#op-btns" aria-expanded="false">
				<span class="icon-bar"></span>
				<span class="icon-bar"></span>
				<span class="icon-bar"></span>
			</button>
			<span class="navbar-brand">
				<i class="icon-globe icon-large"></i>
				${data.type.value}
			</span>
		</div>

		<div class="navbar-collapse" id="op-btns">
			<ul class="nav navbar-nav">
				<#if 'COMPLETED'!=data.status && roles.moneyOutPlan && roles.caigouZhuanze>
				<li class="sub-pay-out-plan" data-id="${data.id}" data-pid="${pId}">
					<a href="javascript:void(0);">
						<div class="text-center op-btn-icon">
							<i class="icon-money icon-large"></i>
						</div>
						付款计划
					</a>
				</li>
				<li class="clearing-contract" data-id="${data.id}" data-pid="${pId}">
					<a href="javascript:void(0);">
						<div class="text-center op-btn-icon">
							<i class="icon-credit-card icon-large"></i>
						</div>
						完工结算
					</a>
				</li>
				<#if !data.hasContractFile>
				<li class="upload-file" data-id="${data.id}" data-pid="${pId}">
					<a href="javascript:void(0);">
						<div class="text-center op-btn-icon">
							<i class="icon-upload icon-large"></i>
						</div>
						上传文件资料
					</a>
				</li>
				</#if> </#if>
			</ul>
			<ul class="nav navbar-nav navbar-right">
				<li class="back-to-main" onclick="location.href='${request.contextPath}/contract/view/${pId}/child-contract';">
					<a href="javascript:void(0);" style="color: #337ab7;">
						<div class="text-center op-btn-icon">
							<i class="icon-reply icon-large"></i>
						</div>
						返回主合同
					</a>
				</li>
			</ul>
		</div>
	</div>
</div>
</div>

<div class="container" style="padding-top: 60px;">
	<div role="tabpanel" class="suredy-tabs">
		<ul class="nav nav-tabs" role="tablist">
			<li id="tab-head1" role="presentation" class="active">
				<a href="#tab1" aria-controls="tab1" role="tab" data-toggle="tab">基本信息</a>
			</li>
			<li id="tab-head2" role="presentation" class="">
				<a href="#tab2" aria-controls="tab2" role="tab" data-toggle="tab">付款信息</a>
			</li>
			<li id="tab-head3" role="presentation" class="">
				<a href="#tab3" aria-controls="tab3" role="tab" data-toggle="tab">付款计划</a>
			</li>
			<li id="tab-head4" role="presentation" class="">
				<a href="#tab4" aria-controls="tab4" role="tab" data-toggle="tab">操作日志</a>
			</li>
		</ul>

		<div class="tab-content">
			<div role="tabpanel" class="tab-pane fade in active" id="tab1">
				<#include "app/contract/contract-sub-view-for-material-info.ftl">
				<hr>
			</div>
			<div role="tabpanel" class="tab-pane fade" id="tab2">
				<#include "app/contract/contract-sub-view-payout.ftl">
				<hr>
			</div>
			<div role="tabpanel" class="tab-pane fade" id="tab3">
				<#include "app/contract/contract-sub-view-payout-plan.ftl">
				<hr>
			</div>
			<div role="tabpanel" class="tab-pane fade op-logs" id="tab4">
				<#include "app/contract/contract-sub-view-op-logt.ftl">
				<hr>
			</div>
		</div>
	</div>
</div>
</#if> </@t.body> <@t.foot>
<script src="${request.contextPath}/core/js/jquery.form.js"></script>
<script src="${request.contextPath}/js/suredy-modal.js"></script>
<script src="${request.contextPath}/js/suredy-datetimepicker.js"></script>
<script src="${request.contextPath}/app/js/file.js"></script>
<script src="${request.contextPath}/app/js/form-checker.js"></script>
<script src="${request.contextPath}/app/contract/js/contract-sub-view.js"></script>
<script src="${request.contextPath}/app/contract/js/contract-money.js"></script>

<script type="text/javascript">
	var refresh = function() {
		$.suredy.refreshContent('${data.id}', '${pId}', [ 'div.suredy-tabs' ]);
	}
</script>
</@t.foot>
